@import "../../variable";

.bucket-wrapper {
  height: 100%;
  display: flex;
  flex-direction: column;

  .buttons-wrapper {
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
    border-bottom: 1px solid $color-border;
    padding: 8px 12px;
  }

  .toolbar-wrapper {
    height: 40px;
    min-height: 40px;
    padding: 8px 12px;
    border-bottom: 1px solid $color-border;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    color: #fff;

    .toolbar-left {
      .ant-space-item {
        display: flex;
        align-items: center;

        .back {
          display: inline-block;
          width: 10px;
          height: 16px;

          &.disabled {
            opacity: 0.3;
            cursor: not-allowed;
          }
        }

        .reload {
          display: inline-block;
          width: 14px;
          height: 14px;
          margin-left: 10px;
        }
      }
    }

    .toolbar-right {
      .ant-space-item {
        display: flex;
        align-items: center;

        .ant-input-affix-wrapper {
          margin: 0 5px;

          .ant-input-prefix {
            img {
              display: inline-block;
              height: 14px;
              width: 14px;
            }
          }
        }

        .mode-icon {
          display: inline-block;
          width: 16px;
          height: 16px;
        }
      }
    }
  }

  .loading-wrapper {
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;

    .ant-spin-container {
      height: 100%;
      position: relative;

      .file-drop {
        height: 100%;

        .file-drop-target {
          height: 100%;

          &.file-drop-dragging-over-frame {
            &::after {
              z-index: 100;
              content: "";
              position: absolute;
              top: 0;
              right: 0;
              bottom: 0;
              left: 0;
              background-color: rgba(0, 0, 0, 0.5);
            }
          }

          &.file-drop-dragging-over-target {
            &::before {
              z-index: 101;
              content: "文件将储存到当前目录下";
              position: absolute;
              top: 10px;
              left: 10px;
              bottom: 10px;
              right: 10px;
              border: 2px #00b3ff dashed;
              border-radius: 10px;
              color: #fff;
              display: flex;
              justify-content: center;
              align-items: center;
            }
          }

          .content-wrapper {
            z-index: 100;
            height: 100%;
            overflow-y: auto;
            overflow-x: hidden;

            .main-table {
              height: 100%;

              .file-meta {
                display: flex;
                flex-direction: row;
                align-items: center;

                .file-icon {
                  font-size: 25px;
                }

                .file-name {
                  overflow: hidden; //超出的文本隐藏
                  text-overflow: ellipsis; //溢出用省略号显示
                  white-space: nowrap; //溢出不换行
                  margin-left: 10px;
                }
              }
            }

            .main-grid {
              min-height: 100%;
              overflow: hidden;

              .main-grid__cell {
                float: left;
                height: 80px;
                width: 80px;
                margin: 5px;
                overflow: hidden;

                &:hover {
                  .main-grid__cell-inner {
                    background: rgba(0, 0, 0, 0.3);
                  }
                }

                .main-grid__cell-inner {
                  padding: 5px;
                  border-radius: 3px;
                  display: flex;
                  flex-direction: column;
                  align-items: center;

                  .preview-image {
                    overflow: hidden;

                    img {
                      width: 50px;
                      height: 50px;
                      object-fit: cover;
                    }
                  }

                  .name {
                    display: inline-block;
                    font-size: 12px;
                    line-height: 17px;
                    width: 100%;
                    color: #fff;
                    text-align: center;
                    padding-top: 3px;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  .footer {
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
    padding: 0 10px;
    border-top: 1px solid $color-border;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;

    .footer-left {
      .current-select {
        color: rgba(255, 255, 255, 1);
      }

      .current-total {
        color: rgba(255, 255, 255, 0.75);
      }
    }
  }
}

.selection {
  background: rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(0, 0, 0, 0.8);
}

.selected {
  transition: background-color 0.2s ease;
  background: rgba(0, 0, 0, 0.2);
}
